	<?php 
		$ci= &get_instance();
		$match_id = intval($_POST['match_id']);
		$listCategory = $ci->category_manual_entity->getListCategoriesByStatus($match_id, 'living');
		$eventCategoryStatus = eventCategoryStatusDataConfig();
		$typeArray = getManualCategoryConfig();
		$betStatus = array('yes' => 'Open' , 'no' => 'Hide');
	?>
	<input type="hidden" name="dialog_mode" id="dialog_mode" value="open" />
	
	<div class="clrboth"></div>
	<div class="grid10" style="width:800px;">
		<input type="button" value="Add Category" onclick="add_category_manual(<?php echo $match_id;?>);" />
		&nbsp;&nbsp;&nbsp;
		<a href="javascript:void(0);" onclick="view_manual_event(<?php echo $match_id;?>);">Live/UpComing Categories</a>
		&nbsp;&nbsp;
		<a href="javascript:void(0);" onclick="view_manual_event_closed(<?php echo $match_id;?>);">Closed Categories</a>
		&nbsp;&nbsp;
		<a href="javascript:void(0);" onclick="view_manual_event_cancelled(<?php echo $match_id;?>);">Cancelled Categories</a>
		&nbsp;&nbsp;
		<a href="javascript:void(0);" onclick="view_manual_event_hidden(<?php echo $match_id;?>);">Hidden Categories</a>
	</div>
	<div class="clrboth"></div>
	<br/>
	<div class="grid10" style="width:800px;">
		<input type="button" value="Apply Answer" onclick="apply_answer_to_all_category_of_match(<?php echo $match_id;?>);" />
		<?php echo loader_image("id='loader_image_apply_answer_to_all_cats' class='hidden'");?>
	</div>	
	<br/>
	<div class="clrboth"></div>
<table>
<thead>
	<th><div class="grid3"><span class="bold" style="font-weight:bold;">Category</span></div></th>
	<th><div class="grid1"><span class="bold" style="font-weight:bold;">Answer</span></div></th>
	<th><div class="grid1"><span class="bold" style="font-weight:bold;">Type</span></div></th>
	<th><div class="grid1"><span class="bold" style="font-weight:bold;">Odds</span></div></th>
	<th><div class="grid1"><span class="bold" style="font-weight:bold;">Bet Enable</span></div></th>
	<th><div class="grid1"><span class="bold" style="font-weight:bold;">Status</span></div></th>
	<th><div class="grid2"><span class="bold" style="font-weight:bold;">Who bet/ Result</span></div></th>
	<th><div class="grid3"><span class="bold" style="font-weight:bold;">Manage</span></div></th>
</thead>	
<tbody>
	<div class="clrboth"></div>
	<?php foreach($listCategory as $item):?>
		<?php $CAT = $ci->category_manual_entity->init('id', $item->id);?>
		<?php if($CAT->getIsOpen() == 'yes'):?>
		<tr>
			<td><?php echo $CAT->getCategoryName();?></td>
			<td>
				<?php if($CAT->getFixAnswer() == 1){echo $CAT->getCorrectAnswer();};?>			
			</td>
			<td><?php echo $typeArray[$CAT->getType()];?></td>
			<td><?php echo $CAT->getOdds();?></td>
			<td>
				<a href="javascript:void(0);" onclick="change_manual_category_open_hide(<?php echo $CAT->getId();?>)">
					<?php echo $betStatus[$CAT->getIsOpen()];?>
				</a>
				<?php echo loader_image("id='loader_image_{$item->id}' class='hidden'");?>
			</td>
			<td><?php echo $eventCategoryStatus[$CAT->getStatus()];?></td>
			<td>
				<a href="javascript:void(0);" onclick="open_window_manual_event(<?php echo $CAT->getId();?>)">
					View
				</a>
			</td>
			<td>
				<a href="javascript:void(0);" onclick="manual_category_edit(<?php echo $CAT->getId();?>)"><?php echo lang('dataman.edit');?></a>
				|
				<a href="javascript:void(0);" onclick="manual_category_cancel(<?php echo $CAT->getId();?>)" >Cancel</a>
				|
				<a href="javascript:void(0);" onclick="manual_category_finish(<?php echo $CAT->getId();?>)" >Finish</a>
				|
				<a href="javascript:void(0);" onclick="manual_category_set_answer(<?php echo $CAT->getId();?>)" >Answer</a>
				<?php echo loader_image("id='loader_image_manual_{$item->id}' class='hidden'");?>
			</td>
		</tr>
		<?php endif;?>
	<?php endforeach;?>
</tbody>
</table>	

